/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.model.item;

import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.packetserver.S_SkillSound;
import com.lineage.server.packetserver.ServerBasePacket;

/**
 * Class <code>SkillEffectGfx</code> 技能效果执行(动画).
 * 
 * @author jrwz
 * @version 2012-6-20上午04:22:19
 * @see com.lineage.server.model.item
 * @since JDK1.7
 */
public final class SkillEffectGfx extends SkillEffect {

    /** 实例. */
    private static SkillEffect instance;

    /**
     * 当第一次实例为空时才新建一个.
     * 
     * @return 实例
     */
    public static SkillEffect get() {
        if (instance == null) {
            instance = new SkillEffectGfx();
        }
        return instance;
    }

    @Override
    public void execute(final L1PcInstance pc, final int gfxId, final byte i) {
        final ServerBasePacket msg = new S_SkillSound(pc.getId(), gfxId);
        switch (i) {
            case 0:
                pc.sendPackets(msg);
                break;
            case 1:
                pc.broadcastPacket(msg);
                break;
            case 2:
                pc.sendPackets(msg);
                pc.broadcastPacket(msg);
                break;
            default:
                break;
        }
    }
}
